<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <base href="<%=basePath%>">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0"> 
 	<%@ include file="/common/importJsCss.jsp" %>
	<script id="template" type="text/x-dot-template">
	{{ for(var prop in it) { }}
			<li id={{=it[prop].id}}>{{=it[prop].text}}</li>
    {{ } }}
	</script>
  </head>  
  <body>
	<div class="container">
        <div class="page-header">
            <h2>开始-遍历数组节点</h2>
        </div>
<pre class="prettyprint linenums"></pre>
		<div id="content"></div>
    </div>
  </body>
  	<script type="text/javascript" id="preJavascript">
var data = [{id:1,text:'Section1',href:'#',pid:0},
			{id:2,text:'Side menu1',href:'#',pid:1},
			{id:3,text:'Side menu2',href:'#',pid:1},
			{id:4,text:'Section2',href:'#',pid:0},
			{id:5,text:'Side menu1',href:'#',pid:4},
			{id:6,text:'Side menu2',href:'#',pid:4},
			{id:7,text:'Section3',href:'#',pid:0},
			{id:8,text:'Side menu1',href:'#',pid:7},
			{id:9,text:'Side menu2',href:'#',pid:7},
			{id:10,text:'Section4',href:'#',pid:0},
			{id:11,text:'Side menu1',href:'#',pid:10},
			{id:12,text:'Side menu2',href:'#',pid:10},
		   ];
var templateFn = doT.template(document.getElementById('template').text);
document.getElementById('content').innerHTML = templateFn(data);
	</script>
</html>
